const { merge } = require('webpack-merge');
const path = require('path');
const commonConfig = require('./webpack.common');

process.env.NODE_ENV = 'development';

/**
 * @type {import("webpack").Configuration}
 */
const devConfig = {
    mode: 'development',
    devtool: 'cheap-module-eval-source-map',
    output: {
        filename: '[name].js',
        path: path.resolve(__dirname, 'dist'),
        // publicPath: '/',
    },

    devServer: {
        port: 8000,
        hot: true,
        contentBase: 'public',
        watchContentBase: true,
        // publicPath: '/',
    },

    plugins: [],
};

module.exports = merge(commonConfig, devConfig);